package net.dgg.zz.credential.certificateProduct.dao;

import net.dgg.zz.credential.certificateProduct.entity.CertificateProduct;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;


/**
 * 证书生产订单中间表
 *
 * @author wmj
 * @date 2018/8/13  10:54
 */
@Component
public interface CertificateProductDao {
    int deleteByPrimaryKey(Long id);

    int insert(CertificateProduct record);

    int insertSelective(CertificateProduct record);

    CertificateProduct selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(CertificateProduct record);

    int updateByPrimaryKey(CertificateProduct record);


    /**
     * <p>@Description 根据条件查中间表数据</p>
     * <p>@author mqy</p>
     * <p>@Time 2018/8/28 0028 14:54 创建时间</p>
     * <p>@return</p>
     */
    List<CertificateProduct> queryByParams(Map map);

    /**
     * 根据证书id查询证书自身绑定的所有销售子订单id
     *
     * @param id
     * @return
     */
    String findOrderIdsByCredentialId(@Param("id") Long id);

    /**
     * 根据销售订单编号查询该销售订单绑定的证书绑定的最新的销售订单No
     *
     * @param orderBusinessNo
     * @return
     */
    Map findOrderInfoByOrderNo(@Param("orderBusinessNo") String orderBusinessNo);
}